#if !defined DATE_H
#define DATE_H

#include <iostream>
using namespace std;

class Date {
public:
	Date(int y=0/*year*/ ,int m=0/*month*/, int d=0/*day*/);
	Date(char strDate[]);
	int daysPerMonth(int m=-1) const;
	int daysPerYear(int y=-1) const;
	int compare(const Date &date) const;
	bool isLeapYear(int y=-1) const;
	int subDate(const Date &date) const;
	Date subDays(int days) const;
	Date addDays(int days) const;
	void prtMsg() const;
	char* toString();
	/********** Operator Overloading ***********/
	Date& operator++();
	Date operator++(int);
	Date& operator--();
	Date operator--(int);
	Date operator+(int days);
	Date operator-(int days);
	int operator-(const Date &date);
	friend ostream& operator<<(ostream &ostrm,const Date &date);
private:
	int year,month,day;
	void addOneDay();
	void subOneDay();
	int subSmallDate(const Date &date) const;
};
#endif
